<script type="text/javascript">
	function validateForm()
	{
		var sname=document.forms["inputStock"]["sname"].value;
		var error = "";
		if (sname==null || sname=="")
			error += "Please fill the name<br>"; 
		var scode=document.forms["inputStock"]["scode"].value;
		if (scode==null || scode=="")
			error += "Please fill the Code<br>"; 
		var sid=document.forms["inputStock"]["sid"].value;
		if (sid==null || sid=="")
			error += "Please fill ID";
                var sprice=document.forms["inputStock"]["sprice"].value;
		if (sprice==null || sprice=="")
			error += "Please fill price<br>"; 
		if (error != "")
		{
			document.getElementById('error').innerHTML=error;
			return false;
		}
		else 
			return true;
	}
    </script>
<body>
<form name='inputStock' id ='inputStock' action='Controller.php?action=inputStock' method='post' onsubmit='return validateForm()'>
<fieldset >
<legend>Input Stock</legend>
<br> 
<label for='scode' >Code*:</label>
<input type='text' name='scode' id='scode' maxlength="50" />
<br>
<label for='sprice' >Price*:</label>
<input type='text' name='sprice' id='sprice' maxlength="50" />
<br>
<label for='name' >Name of Stock*:</label>
 <input type='text' name='sname' id='sname' maxlength="50" />
 <br>
<input type="submit" value="Check in">
<input type='reset' value='Reset'>
</fieldset>
</form>
<font color='red'><p id='error'></p></font>
</body>